import React, { Component } from 'react';
import {NavLink,Link} from 'react-router-dom'
import axios from 'axios'

class Bottom extends Component {
    constructor(props){
        super(props);
        this.state={
            bottomdata:[]
        }
    }
    
    componentDidMount(){
        axios.get("/api/bottom").then((res)=>{
            this.setState({
                bottomdata:res.data.list
            })
        })
    }
    
    render() {
        return (
            <div className="bottom">
                {
                this.state.bottomdata.map((item,index)=>{
                    return (
                        
                        <NavLink key={index} to={item.link}><img src={item.icon} alt=""/>{item.text}</NavLink>
                    )
                })
                }
            </div>
        );
    }
}  



export default Bottom;